libxl: remove console 0 backend directory from xenstore on devices destroy
authorIan Campbell <ian.campbell@citrix.com>
Tue, 5 Oct 2010 16:51:28 +0000 (17:51 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 5 Oct 2010 16:51:28 +0000 (17:51 +0100)
commit5588033df56a5ac935ded5ae8587bc5841314863
tree0de96be4bfa5f8d3cf3bbf46ea419560cc2fa724
parentd2cd9d41fdf0d85572c06735ea4202d4969fcd1b
libxl: remove console 0 backend directory from xenstore on devices destroy

The first PV console device has an unusual frontend path for
historical reasons (/local/domain/<domid>/console rather than
/local/domain/<domid>/device/console/0).

Therefore we need to check this additional frontend path as well as
those under /local/domain/<domid>/device when tearing down all
backends or else we miss the backend for the console.

As part of this we need to ensure that the frontend directory has a
valid link to the backend, currently this link does not exist.

Fix this by adding libxl__device_frontend_path to return the correct
frontend path, accounting for the special case, and use it from
libxl__device_add_generic. Also add libxl__device_backend_path for
consistency.

This also allows console 0 setup to follow essentially the same code
path as other consoles within libxl_device_console_add, reducing the
special casing required there.

This also fixes the link from backend to frontend which until now gave
a dangling link to the normal device path instead of the exceptional
one.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl_device.c